
class CleanDatabaseJob {
    //def timeout = 5000l // execute job once in 6 seconds
    def cronExpression = "0 0 0 * * ?" // weekly

    def execute() {
        // clean tables in natenews databse
        println "CleanDatabaseJob - ${new Date()}"
        Article.executeUpdate("delete Article article")
        RankInfo.executeUpdate("delete RankInfo rankInfo")
        ArticleRank.executeUpdate("delete ArticleRank articleRank")
        Reply.executeUpdate("delete Reply reply")
    }
}
